import request from '@/utils/request'

// 定义公共的api 
const BASE_URL = '/admin/system/sysCourse';

export default{

  findAll(){
    return request({
      url:`${BASE_URL}/findAll`,
      method: 'get'
    })
  },
  getCoursePageInfo(page,limit,searchObj){
    return request({
      url:`${BASE_URL}/${page}/${limit}`,
      method: 'get',
      params:searchObj
    })
  },

  removeCourseById(id){
    return request({
      url:`${BASE_URL}/removeCourse/${id}`,
      method: 'delete'
    })
  },
  addCourse(Course){
    return request({
      url:`${BASE_URL}/addCourse`,
      method: 'post',
      data:Course
    })
  },
  updateCourse(Course){
    return request({
      url:`${BASE_URL}/updateCourse`,
      method: 'post',
      data:Course
    })
  },
  findCourseById(id){
    return request({
      url:`${BASE_URL}/findCourseById/${id}`,
      method: 'get'
    })
  },
    // 8、更改用户状态
    updateStatus(id,status){
        return request({
            url:`${BASE_URL}/updateStatus/${id}/${status}`,
            method: 'get'
          }) 
     },

     //是否推荐 switchRecommend
     updateRecommend(id,recommend){
      return request({
          url:`${BASE_URL}/updateRecommend/${id}/${recommend}`,
          method: 'get'
        }) 
   },


    //  播放视频
      // 根据id获取palyAuth播放凭证
  getPlayAuthById(id){
    return request({
      url:`${BASE_URL}/getPlayAuth/${id}`,
      method: 'get'
    })
  },

    //  查询推荐的课程
  findRecommend(){
    return request({
      url:`${BASE_URL}/findRecommend`,
      method: 'get'
    })
  },
  
}


